package com.example.JavaWebApi.controller.systemController;

import com.example.JavaWebApi.model.vo.systemVo.CreatePersonVo;
import com.example.JavaWebApi.service.systemService.IFaceDetectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: sdsf_api
 * @description: 人脸识别控制器
 * @author: 杨泽
 * @create: 2023-06-27 13:23
 */
@RestController
@RequestMapping("/api/faceDetection")
//@Authorize
@Api(tags ="人脸识别")
public class FaceDetectionController {
    @Autowired
    private IFaceDetectionService faceDetectionService;

    @GetMapping("CreateGroup")
    @ApiOperation("创建人员组")
    public boolean createGroup() {
        return faceDetectionService.createGroup();
    }

    @PostMapping("CreatePerson")
    @ApiOperation("创建人员")
    public boolean createPerson(@RequestBody CreatePersonVo createPersonVo) {
        return faceDetectionService.createPerson(createPersonVo);
    }

    @PostMapping("AddFaces")
    @ApiOperation("添加人脸")
    public boolean addFaces(@RequestBody List<String> faces) {
        return faceDetectionService.addFaces(faces);
    }
}